/*
 * Copyright 2023, Haiku, Inc.
 * Distributed under the terms of the MIT License.
 */
#ifndef DISASSEMBLER_LOONGARCH64_H
#define DISASSEMBLER_LOONGARCH64_H

#include <String.h>

#include "Types.h"


class CpuState;
class InstructionInfo;


class DisassemblerLoongArch64 {
public:
								DisassemblerLoongArch64();
	virtual					~DisassemblerLoongArch64();

	virtual	status_t		Init(target_addr_t address, const void* code,
								size_t codeSize);

	virtual	status_t		GetNextInstruction(BString& line,
								target_addr_t& _address,
								target_size_t& _size,
								bool& _breakpointAllowed);
	virtual	status_t		GetPreviousInstruction(
								target_addr_t nextAddress,
								target_addr_t& _address,
								target_size_t& _size);

	virtual	status_t		GetNextInstructionInfo(
								InstructionInfo& _info,
								CpuState* state);

private:
			struct DisassemblerData;

private:
			target_addr_t		fAddress;
			const uint8*		fCode;
			size_t				fCodeSize;
			DisassemblerData*	fDisassemblerData;
};


#endif	// DISASSEMBLER_LOONGARCH64_H